package com.momoauth.common.security.annotation;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.momoauth.common.security.utils.SensitiveSerialize;
import com.momoauth.common.security.enumeration.SensitiveType;

import java.lang.annotation.*;

/**
 * 数据脱敏
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@JacksonAnnotationsInside
@JsonSerialize(using = SensitiveSerialize.class)
public @interface Sensitive {
    SensitiveType type() default SensitiveType.CUSTOMER;
    int prefixNoMaskLen() default 0;
    int suffixNoMaskLen() default 0;
    String symbol() default "*";
}
